import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';

class BleOffPage extends StatefulWidget {
  @override
  _BleOffPageState createState() => _BleOffPageState();
}

class _BleOffPageState extends State<BleOffPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("打开蓝牙"),
      ),
      body: Column(
        children: [
          ElevatedButton(
              onPressed: () async {
                await FlutterBluePlus.turnOn();
              },
              child: Text("蓝牙已关闭，点击打开"))
        ],
      ),
    );
  }
}
